<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<link rel="stylesheet" type="text/css"
	href="<c:url value="/static/jquery-easyui/themes/default/easyui.css"/>">
<link rel="stylesheet" type="text/css"
	href="<c:url value="/static/jquery-easyui/themes/icon.css"/>">
<link rel="Stylesheet" type="text/css"
	href="<c:url value="/static/css/jquery.ui.css"/>" />
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/jquery-1.6.min.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/jquery.easyui.min.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/plugins/jquery.panel.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/plugins/jquery.datagrid.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/plugins/jquery.messager.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/ext-for-framework.js.jsp"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/locale/easyui-lang-zh_CN.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/js/common.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/js/Loading.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/js/showMsg.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/listBox/jquery.clever.listbox.js"/>"></script>

<script>
	//添加信息按钮响应函数
	function addCompany() {
		$('#AddCompanyForm').form('submit', {
			url : '<c:url value='/companySup/saveCompanyForSup.do'/>', //查询提交路径
			onSubmit : function()//提交按钮相应函数
			{
				
				
				//document.getElementById("permissionString").value = $('#permission').combobox('getValues');
				
				return $('#AddCompanyForm').form('validate');
			},
			success : function(data) {
				data = eval('(' + data + ')');
				if (data.success) {
					window.opener.window.tea();
					$.messager.alert('系统提示', '修改成功', 'info', function() {
						window.close();
					});
				} else {
					$.messager.alert("提示", data.msg, 'warning');
				}
			},
			error : function() {
				$.messager.alert("错误", "系统错误，请联系管理员！", 'error');
				return;
			}
		});

	}
    var data = "";
	$(document).ready(function() {
		/* $('#permission').combobox({    
		    required:true,    
		    multiple:true,
            editable:false, //不可编辑状态  
		    valueField:'permission',     
            textField:'permissionText',  
	        data:[{"permission":"1","permissionText":"店面权限"},{"permission":"2","permissionText":"供货商权限"}]  

		});   */
    });

	
</script>
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
</head>

<body>
	<table width="90%" align="center">
		<tr></tr>
		<tr>
			<td>

				<div style="height: auto; background: #fafafa; padding: 5px;"
					class="easyui-panel" title="添加公司信息" iconCls="icon-save"
					collapsible="true" minimizable="false" maximizable="false"
					closable="false">

					<form id="AddCompanyForm" name="AddCompanyForm" method="post">
						<table cellpadding="5">
							<tr>
								<td>公司名称:</td>
								<td><input class="easyui-validatebox" type="text"
									name="companyName" required="true" /></td>
							</tr>
							<tr>
								<!-- <td>经营权限（多选）</td> -->
								<td><input id="permission" name="permission" hidden='true' >
								</td>
								<td><input id="permissionString" value="1" name="permissionString" type="hidden">
							</tr>
						</table>
						<a class="easyui-linkbutton" onclick="addCompany()">新增</a>
					</form>

				</div>
			</td>
		</tr>
	</table>

</body>
</html>